/*jslint newcap:true, browser: true, devel: true, bitwise: true, white: true, plusplus: true, nomen:true */
/*global $:true, define:true */

define(['WID/Core/Class'], function(Class) {
"use strict";

function Simple(a1, a2) {
	this.sum = a1+a2;
}Class(Simple,{
methods: {
	constructor: Simple,
	getSum: function() {
		return this.sum;
	}
}
});

function SimpleChild(a1, a2, a3) {
	this.$super.constructor.call(this,a1,a2);
	this.sum += a3;
}var extend = Class(SimpleChild,{
base: Simple
});

extend.getSum = function() {
	return this.$super.getSum.call(this);
};

return {
	name:'Class', 
	desc:'Its testing class creating',
	
	tests:[
		function creatingSimpleClass() {
			var obj1 = new Simple(0,1);
			
			this.expect(Simple.prototype.constructor).toBe(Simple);
			
			this.expect(obj1.constructor).toBe(Simple);
			this.expect(obj1.getSum()).toBe(obj1.sum);
			this.expect(obj1.sum).toBe(1);
		},
		
		function creatingChildClass() {
			var obj2 = new SimpleChild(0,1,2);
			
			this.expect(SimpleChild.prototype.constructor).toBe(SimpleChild);
			
			this.expect(obj2.constructor).toBe(SimpleChild);
			this.expect(obj2.getSum()).toBe(obj2.sum);
			this.expect(obj2.sum).toBe(3);
		},
		
		function superTest() {
			
		}
	]
};
});
